//
//  ViewController.m
//  MJMulMenu
//
//  Created by HuiJiaHuDong on 2017/9/7.
//  Copyright © 2017年 HuiJia. All rights reserved.
//

#import "ViewController.h"
#import "MulMenuView.h"
#import "MJMenuItem.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
	[super viewDidLoad];
	
	self.automaticallyAdjustsScrollViewInsets = YES;
	
	//模拟数据
	NSMutableArray *dataArr = [NSMutableArray array];
	
	for (NSInteger i = 0; i < 10; i++)
	{
		
		//左侧tableVIew的数据
		MJMenuItem *tableItem = [[MJMenuItem alloc] init];
		
		tableItem.meunName = [NSString stringWithFormat:@"第%zd号菜单",i];
		
		//右侧col组数据
		tableItem.nextArray = [NSMutableArray array];
		
		//二级列表的数据
		for (NSInteger j = 0; j < arc4random() % 10; j++)
		{
			
			
			MJMenuItem *rightSectioncolItem = [[MJMenuItem alloc] init];
			
			rightSectioncolItem.meunName = [NSString stringWithFormat:@"第%zd菜单的的第%zd组",i,j];
			
			[tableItem.nextArray addObject:rightSectioncolItem];
			
			rightSectioncolItem.nextArray = [NSMutableArray array];
			
			for (NSInteger k = 0; k < arc4random() % 15; k++)
			{
				
				MJMenuItem *rightRowcolItem = [[MJMenuItem alloc] init];
				
				rightRowcolItem.meunName = [NSString stringWithFormat:@"%zd组%zd个",j,k];
				
				rightRowcolItem.urlName = @"ipone1";
				
				[rightSectioncolItem.nextArray addObject:rightRowcolItem];
				
				
			}
			
		}
	
		[dataArr addObject:tableItem];
	}
	
	MulMenuView *menuView = [[MulMenuView alloc] initWithFrame:self.view.bounds WithData:dataArr andStartIndex:0];
	
	[self.view addSubview:menuView];
	
	
	
}




@end
